
package com.hlkj.pay.app.merchant.ext.impl.fuyou.dto;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import com.hlkj.framework.common.util.json.JsonUtils;

import lombok.Data;

/**
 * @author HlpayTeam
 * @date 2024/11/18 13:48
 */
@Data
public class FuYouPayOrderResultDto extends FuYouPayResultCommonDto {

    /**
     * addn_inf : buyer_id : oi_0ms6QTI61lzX647RDjHhcVDBY ins_cd : 08A9999999
     * mchnt_cd : 0002900F0370542 mchnt_order_no : 2020120115294222446445 order_amt
     * : 1 order_type : WECHAT random_str : F6P6XQR8QKNS3HHONR3TY6T00ANC7ZWH
     * reserved_bank_type : COMM_DEBIT reserved_buyer_logon_id :
     * reserved_channel_order_id : 2020120115294222446445 reserved_coupon_fee : 0
     * reserved_fund_bill_list : reserved_fy_settle_dt : 20201201
     * reserved_fy_trace_no : 120186438960 reserved_is_credit : 0
     * reserved_settlement_amt : 1 reserved_txn_fin_ts : 20201201152946 result_code
     * : 000000 result_msg : SUCCESS sign :
     * Ky1ITNPASHlHb3pfAJcUfDgAOCi3p5lDABXU4ej0Oe29hWqnKJFLwsHjKqKPBbD6vzkRouGGQUVPPXEDIgc0h5+krEl+nJDUG7+UEKWZqN7X5rPZyB5UBTLrkZJTTOmqXnyyV6UG9gnsg36/v/6yunN4mUt5hbysvXtVUiSjEoE=
     * term_id : 12345678 trans_stat : SUCCESS transaction_id :
     * 4200000747202012013659872912
     */
    // 附加数据
    private String addn_inf;

    // 买家在渠道(微信、支付宝)的用户ID
    private String buyer_id;

    // 商户订单号, 商户系统内部的订单号
    private String mchnt_order_no;

    // 订单金额，单位为分
    private Integer order_amt;

    // 订单类型:
    // JSAPI--公众号支付
    // FWC--支付宝服务窗、支付宝小程序
    // LETPAY-微信小程序
    // MPAY--云闪付小程序（控件支付）
    // UPBXJS--云闪付保险缴费
    // ALIPAY(支付宝)
    // WECHAT(微信)
    // UNIONPAY(银联二维码)
    // BESTPAY(翼支付)
    // DIGICCY(数字货币)
    // PY68(银联分期-商户贴息)
    // PY69(银联分期-持卡人贴息)
    private String order_type;

    // 付款方式
    private String reserved_bank_type;

    // 买家在渠道登录账号
    private String reserved_buyer_logon_id;

    // 条码流水号，用户账单二维码对应的流水
    private String reserved_channel_order_id;

    // 优惠金额(分)
    private Integer reserved_coupon_fee;

    // 支付宝交易资金渠道，详细渠道
    private String reserved_fund_bill_list;

    // 富友交易日期
    private String reserved_fy_settle_dt;

    // 富友系统内部追踪号
    private String reserved_fy_trace_no;

    // 1--表示信用卡或者花呗
    // 0--表示其他(非信用方式)
    // 不填，表示未知
    private String reserved_is_credit;

    // 应结算订单金额，分为单位的整数。
    // 只有成功交易才会返回
    // 如果使用了商户免充值优惠券，该值为订单金额-商户免充值
    // 如果没有使用商户免充值，该值等于订单金额
    private Integer reserved_settlement_amt;

    // 用户支付时间yyyyMMddHHmmss
    private String reserved_txn_fin_ts;

    // 终端号
    private String term_id;

    // 返回码 trans_stat 状态
    // 000000 SUCCESS 成功
    // 错误码(多个) PAYERROR 失败
    // 000000 USERPAYING 支付中
    // 000000 NOTPAY 未支付
    // 9999 系统错误，需要继续查询
    // 000000 CLOSED 已关闭
    // 000000 REVOKED 已撤销
    // 000000 REFUND 已退款
    // 1010 空 找不到交易
    private String trans_stat;

    // 渠道订单号
    private String transaction_id;

    // 富友终端号(富友终端号与TUSN号二选一)
    private String reserved_fy_term_id;

    // 微信营销详情（资金单位：分），见文档中
    private String reserved_promotion_detail;

    // 支付宝交易支付时所使用的所有优惠券信息（资金单位：元）
    // "[{"amount":"1.00","merchant_contribute":"1.00",
    // "name":"1.00元代金券","other_contribute":"0.00",
    // "template_id":"20221107000730017617007JGOUG",
    // "id":"202211070007300282330EB2Y9QQ",
    // "type":"ALIPAY_BIZ_VOUCHER"}]"
    private String reserved_voucher_detail_list;

    // 支付宝交易支付所使用的单品券优惠的商品优惠信息（资金单位：元）
    // "[{"goodsId":"STANDARD1026181538","
    // goodsName":"雪碧","discountAmount":"10.00"}]"
    private String reserved_discount_goods_detail;

    // 返回值：1=商户出息
    private String reserved_hb_is_seller;

    // 手续费减免标识
    // Y：表示减免（默认）
    // N：表示不减免
    private String reserved_service_charge_flag;

    // 交易子商户号
    private String reserved_sub_mchnt_cd;

    // 交易类型
    // ALBS支付宝被扫、WXBS微信被扫、WXFP微信刷脸、ALFP支付宝刷脸、
    private String reserved_trade_type;

    // 预支付交易会话标识,富友返回支付宝生成的预支付回话标识，用于后续接口调用中使用，该值有效期为2小时
    private String session_id;

    // 二维码链接
    private String qr_code;

    // 富友生成的订单号,需要商户与商户订单号进行关联
    private String reserved_fy_order_no;

    private String reserved_is_deducte_fee;

    private String total_amount;

    private String reserved_mchnt_order_no;

    private String reserved_async_payment_mode;

    private String reserved_risk_info;

    private String out_trade_no;

    private String in_order_no;
    private String txn_fin_ts;
    private Integer total_fee;
    //1.支付成功，2退款成功，3撤销成功，4冲正成功
    private Integer pay_status;

    public static void main(String[] args) {
        String json = "{\"reserved_sub_mchnt_cd\":\"492268365\",\"sign\":\"YdCl6ipzYa/FvnUAySpeBtkI7rEQjGSwcc24LD 4/S6zAF5 XDGhihImz04U09f1zUzfsl67D3RfbwLMa1cD7b1N70M2914mpZW9elF1K7dvKCbIE2p272596FDrdubJ33KSdJV8A0G2IDinyT7d7fSnPV 7KX37aKX0dg8 wWc=\",\"buyer_id\":\"\",\"mchnt_cd\":\"0002900F0370542\",\"reserved_fy_settle_dt\":\"20241119\",\"reserved_fund_bill_list\":\"\",\"reserved_buyer_logon_id\":\"\",\"random_str\":\"Z5SCT45UT7ETST8APGCC7XE7DNM9HN7D\",\"reserved_channel_order_id\":\"\",\"reserved_txn_fin_ts\":\"\",\"order_type\":\"WECHAT\",\"reserved_is_credit\":\"0\",\"transaction_id\":\"\",\"ins_cd\":\"08A9999999\",\"reserved_mchnt_order_no\":\"D20241119142424108802823\",\"reserved_async_payment_mode\":\"\",\"reserved_risk_info\":\"\",\"term_id\":\"F0370542\",\"reserved_coupon_fee\":\"\",\"reserved_fy_trace_no\":\"110241911693\",\"addn_inf\":\"\",\"reserved_fy_order_no\":\"\",\"result_msg\":\"101二维码已过期，请刷新再试\",\"total_amount\":\"1\",\"reserved_is_deducte_fee\":\"2\",\"result_code\":\"030001\"}";
        System.out.println(JsonUtils.parseObject(json, FuYouPayOrderResultDto.class));
    }

}
